/**
 * @file entry
 * @author flower.cheng(flower.cheng@boqii.com)
 */

import Vue from 'vue';
import Meta from 'vue-meta';

import {
  createRouter
} from '@/.lavas/router';
import {
  createStore
} from '@/.lavas/store';
import AppComponent from './App.vue';
// import Vuetify from 'vuetify';
// import '@/assets/lib/font-size';
import '@/service/filters';
import '@/service/directives';
import 'mint-ui/lib/style.css'
import '@/assets/css/reset.css'
import '@/assets/scss/app.scss'
import 'boqii-modal';
import MintUI from 'mint-ui'
import boqiiJsApi from 'boqiijssdk'
// import infiniteScroll from 'vue-infinite-scroll'
window.boqiiJsApi = boqiiJsApi
if (!boqiiJsApi.isInsideApp) {
  appBrige._sendMessageToApp = function () {
    return;
  }
}
// import Env from '../core/Env.js';
// import vConsole from 'vconsole';
// new vConsole();

console.log('---BoqiiJsApi isInsideApp---:', boqiiJsApi.isInsideApp)

Vue.use(Meta);
Vue.use(MintUI)
// Vue.use(infiniteScroll)
// Vue.use(Vuetify);

Vue.config.productionTip = false;
//判断是否是微信打开
// if( navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1 ){
//   let redirectUrl = Env.getRedirectUrl();
//   if( !localStorage.getItem("wechatCode") ){
//       window.location.href = redirectUrl;
//   }
// }

export function createApp() {
  let router = createRouter();
  let store = createStore();
  let App = Vue.extend({
    router,
    store,
    ...AppComponent
  });
  return {
    App,
    router,
    store
  };
}

if (module.hot) {
  module.hot.accept();
}